<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增信用管理')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-credit-add">
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">编码：</label>
                <div class="col-sm-8">
                    <input name="code" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">删除：</label>
                <div class="col-sm-8">
                    <input name="isDelete" class="form-control" type="text" th:value="0">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">类型：</label>
                <div class="col-sm-8">
                    <div class="radio">
                        <label>
                            <input type="radio" checked="" value="add" id="optionsRadios1" name="type">加分项</label>
                    </div>
                    <div class="radio">
                        <label>
                            <input type="radio" value="minus" id="optionsRadios2" name="type">减分项</label>
                    </div>
                </div>
            </div>
            <div class="form-group" hidden>
                <label class="col-sm-3 control-label is-required">状态：</label>
                <div class="col-sm-8">
                    <input name="status" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">分数：</label>
                <div class="col-sm-8">
                    <input name="descore" class="form-control" type="text" placeholder="-1.5">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">信息：</label>
                <div class="col-sm-8">
                    <textarea name="info" class="form-control" type="text"></textarea>
                </div>
            </div>
            <div class="form-group" hidden>
                <label class="col-sm-3 control-label">删除：</label>
                <div class="col-sm-8">
                    <input name="isDelete" class="form-control" type="text">0
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "wstudy/credit"
        $("#form-credit-add").validate({
            focusCleanup: true,
            onkeyup:false,
            rules:{
                code:{
                    required:true,
                    number: true
                },
                descore:{
                    required:true,
                    number: true
                }
            },
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-credit-add').serialize());
            }
        }
    </script>
</body>
</html>